package com.link.base.base.dept.service;

import com.link.base.base.dept.model.Department;
import com.link.base.base.dept.model.DepartmentRelation;
import com.link.base.base.orgnization.model.Orgnization;
import com.link.core.basic.service.BasicService;

import java.util.List;
import java.util.Map;

/**
 * Copyright  hande Company. All Rights Reserved.
 *
 * @author  unknwon
 * @date:   2018/11/9 16:19
 * @version 1.0
 */

public interface DepartmentService extends BasicService<Department> {


    /**
     * 查询根部门
     * @param entity
     * @return
     * @throws Exception
     */
    public Department queryRoot(Department entity) throws Exception;

    /**
     * 查询部门列表表排除主键为Id的部门和其子部门
     * @param entity
     * @return
     * @throws Exception
     */
    public List<Department> queryDepartmentListRemoveIdAndChildrenPage(Department entity) throws Exception;

    /**
     * 根据根部门查询部门树
     * @param entity
     * @throws Exception
     */
    public void queryTreeByRoot(Department entity) throws Exception;


    /**
     * 用于画结构图
     * @param entity
     * @throws Exception
     */
    public void queryTreeByRoot1(Department entity) throws Exception;


    /**
     * 根据ID递归删除该记录以及其子对象
     * @param entity
     * @throws Exception
     */
    public void deleteWithChildById(Department entity) throws Exception;

    /**
     * <p>根据集成ID在本系统中查找部门信息，无则返回空</p>
     * @author yrf
     * @param model
     * @return
     * @throws Exception
     */
    public Department getDept(Department model) throws Exception;

    /**
     * <p>根据父部门集成ID在本系统中查找父部门，无则报错</p>
     * @author yrf
     * @param model
     * @return
     * @throws Exception
     */
    public Department getParentDept(Department model) throws Exception;

    /**
     * <p>根据组织集成ID在本系统中查找组织</p>
     * @author yrf
     * @param model
     * @return
     * @throws Exception
     */
    public Orgnization getOrg(Department model) throws Exception;

    /**
     * 获取多层级部门关联关系
     * @author 姚江漪
     * @date 2019/04/02 23:20
     * @param departmentRelation
     */
    public List<DepartmentRelation> queryAreaRegionPage(DepartmentRelation departmentRelation) throws Exception;


    /**
     * 提供app根据部门获取战区、片区、大区信息
     * @author 姚江漪
     * @date 2019/04/17 17:32
     */
    public Map<String,Object> queryAPPUserAreaRegion(Department entity) throws Exception;

}
